package com.innovativethinking.web.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.users.UserService;
import com.google.inject.Inject;
import com.google.inject.Singleton;



@SuppressWarnings("serial")
@Singleton
public class LogOutServlet extends HttpServlet {
	
	@Inject private UserService userService = null;
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
		req.getSession().invalidate();		
		resp.sendRedirect(userService.createLogoutURL("/"));
	}		
	
}
